﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FangDuShi_Admin.Model
{
    [Serializable]
    public partial class IPWhiteList
    {
        public IPWhiteList()
        {
        }
        public static String LongToIP(long para)
        {
            Int64 ip = Convert.ToInt64(para);
            String str = "";
            str += ip % 256;
            ip /= 256;
            str = ip % 256 + "." + str;
            ip /= 256;
            str = ip % 256 + "." + str;
            ip /= 256;
            str = ip % 256 + "." + str;
            return str;
        }
        #region Model
        /// <summary>
        /// 序号
        /// </summary>
        public decimal FID
        {
            set;
            get;
        }
        /// <summary>
        /// 起始IP
        /// </summary>
        public long FStartIP
        {
            set;
            get;
        }
        public string FStartIPStr
        {
            get
            {
                if (string.IsNullOrEmpty(FStartIP.ToString()))
                {
                    return "";
                }
                else
                {
                    return LongToIP(FStartIP);
                }


            }
        }
        /// <summary>
        /// 结束IP
        /// </summary>
        public long FEndIP
        {
            set;
            get;
        }
        public string FEndIPStr
        {

            get
            {

                if (string.IsNullOrEmpty(FEndIP.ToString()))
                {
                    return "";
                }else
                {

                    return LongToIP(FEndIP);
                }

            }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string FNote
        {
            set;
            get;
        }
        #endregion Model

    }
}

